add_subdirectory(rust)

# configure files
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/version.h)

set(REGEX_SOURCES
    main.c
    rust.c
    re2.cpp
)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/rust/include
)

if(CMAKE_BUILD_TYPE MATCHES "^Release")
    link_directories(${PROJECT_BINARY_DIR}/rregex/release)
else()
    link_directories(${PROJECT_BINARY_DIR}/rregex/debug)
endif()

add_executable(regex_perf ${REGEX_SOURCES})

add_dependencies(regex_perf librregex)

target_link_libraries(regex_perf re2 rregex ${REGEX_ENGINES} pthread dl m)
